package com.ywjt.platformbusiness.home.adapter;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.home.CommonModel;

import java.util.List;

public class HomeGoodsTypeAdapter extends BaseQuickAdapter<CommonModel, BaseViewHolder> {

    public HomeGoodsTypeAdapter(@Nullable List<CommonModel> data) {
        super(R.layout.item_home_type1, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommonModel item) {
        helper.setText(R.id.tvTitle,item.getStr());
        TextView tvTitle=helper.getView(R.id.tvTitle);


        if (item.getSelected()){
            helper.getView(R.id.ivLine).setVisibility(View.VISIBLE);
            tvTitle.setTextColor(mContext.getResources().getColor(R.color.red));
            tvTitle.getPaint().setFakeBoldText(true);
        }else {
            helper.getView(R.id.ivLine).setVisibility(View.GONE);
            tvTitle.setTextColor(mContext.getResources().getColor(R.color.black));
            tvTitle.getPaint().setFakeBoldText(true);
        }
    }
}
